<template>
  <div class="edit-wr">
    <!-- 录入 -->
    <el-dialog
      title="详情"
      center
      :visible.sync="showDialog"
      width="50%"
      custom-class="dialog-detail"
      @close="closeDialog"
      v-cloak
    >
      <el-form
        :model="editData"
        ref="editData"
        label-width="200px"
        class="demo-editData"
      >
        <el-form-item
          label="产品大类："
          prop="productBigType"
        >
          <el-input v-model="editData.productBigType"></el-input>
        </el-form-item>
        <el-form-item
          label="产品小类名称："
          prop="productSmallType"
        >
          <el-select
            placeholder="请选择产品小类名称："
            style="width:100%"
            v-model="editData.productSmallType"
          >
            <el-option
              label="房产贷"
              value="1"
            ></el-option>
            <el-option
              label="房月供贷"
              value="2"
            ></el-option>
            <el-option
              label="装修贷"
              value="3"
            ></el-option>
            <el-option
              label="车月供贷"
              value="4"
            ></el-option>
            <el-option
              label="保单信用贷"
              value="5"
            ></el-option>
            <el-option
              label="社保贷"
              value="6"
            ></el-option>
            <el-option
              label="公积金贷"
              value="7"
            ></el-option>
            <el-option
              label="工资流水贷"
              value="8"
            ></el-option>

            <el-option
              label="企业税贷"
              value="9"
            ></el-option>
            <el-option
              label="企业票贷"
              value="10"
            ></el-option>
            <el-option
              label="企业流水贷"
              value="11"
            ></el-option>
            <el-option
              label="房抵经营贷"
              value="12"
            ></el-option>

            <el-option
              label="房抵消费贷"
              value="13"
            ></el-option>
            <el-option
              label="押车车贷"
              value="14"
            ></el-option>
            <el-option
              label="押证车贷"
              value="15"
            ></el-option>

          </el-select>
        </el-form-item>
        <el-form-item
          label="产品编号："
          prop="productCode"
        >
          <el-input v-model="editData.productCode"></el-input>
        </el-form-item>
        <el-form-item
          label="产品名称："
          prop="productName"
        >
          <el-input v-model="editData.productName"></el-input>
        </el-form-item>
        <el-form-item
          label="抵押物所在地："
          prop="houseAddr"
        >
          <el-input v-model="editData.houseAddr"></el-input>
        </el-form-item>
        <el-form-item
          label="最小风险系数："
          prop="riskMin"
        >
          <el-input v-model="editData.riskMin"></el-input>
        </el-form-item>
        <el-form-item
          label="最大风险系数："
          prop="riskMax"
        >
          <el-input v-model="editData.riskMax"></el-input>
        </el-form-item>
        <el-form-item
          label="最小额度(万)："
          prop="quotaMin"
        >
          <el-input v-model="editData.quotaMin"></el-input>
        </el-form-item>
        <el-form-item
          label="最大额度(万)："
          prop="quotaMax"
        >
          <el-input v-model="editData.quotaMax"></el-input>
        </el-form-item>
        <el-form-item
          label="最低利率(%)："
          prop="rateMin"
        >
          <el-input v-model="editData.rateMin"></el-input>
        </el-form-item>
        <el-form-item
          label="最高利率(%)："
          prop="rateMax"
        >
          <el-input v-model="editData.rateMax"></el-input>
        </el-form-item>
        <el-form-item
          label="最低期限(月)："
          prop="termMin"
        >
          <el-input v-model="editData.termMin"></el-input>
        </el-form-item>

        <el-form-item
          label="最高期限(月)："
          prop="termMax"
        >
          <el-input v-model="editData.termMax"></el-input>
        </el-form-item>
        <el-form-item
          label="还款方式："
          prop="repaymentWay"
        >
          <el-select
            v-model="editData.useModule"
            placeholder="请选择还款方式"
            style="width:100%"
          >
            <el-option
              label="先息后本"
              value="1"
            ></el-option>
            <el-option
              label="等额还款"
              value="2"
            ></el-option>
            <el-option
              label="随借随还"
              value="3"
            ></el-option>
            <el-option
              label="按日计息"
              value="4"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item
          label="还款方式名称："
          prop="repaymentWayName"
        >
          <el-input v-model="editData.repaymentWayName"></el-input>
        </el-form-item>
        <el-form-item
          label="审批时间："
          prop="approvalTime"
        >
          <el-input v-model="editData.approvalTime"></el-input>
        </el-form-item>
        <el-form-item
          label="可贷成数："
          prop="loanRatio"
        >
          <el-input v-model="editData.loanRatio"></el-input>
        </el-form-item>
        <el-form-item
          label="产品亮点："
          prop="productHighlights"
        >
          <el-input v-model="editData.productHighlights"></el-input>
        </el-form-item>

        <el-form-item
          label="产品标签："
          prop="productLabel"
        >
          <el-input v-model="editData.productLabel"></el-input>
        </el-form-item>
        <el-form-item
          label="申请条件："
          prop="applicationConditions"
        >
          <el-input
            type="textarea"
            v-model="editData.applicationConditions"
          ></el-input>
        </el-form-item>
        <el-form-item
          label="办理资料"
          prop="handlingInformation"
        >
          <el-input
            type="textarea"
            v-model="editData.handlingInformation"
            placeholder="请输入办理资料"
          ></el-input>
        </el-form-item>
        <el-form-item
          label="办理流程"
          prop="handlingProcess"
        >
          <el-input
            type="textarea"
            v-model="editData.applicationConditions"
            placeholder="请输入办理流程"
          ></el-input>
        </el-form-item>
        <el-form-item
          label="常见问题"
          prop="commonProblem"
        >
          <el-input
            type="textarea"
            v-model="editData.commonProblem"
            placeholder="请输入常见问题"
          ></el-input>
        </el-form-item>
        <el-form-item
          label="使用模块："
          prop="useModule"
        >
          <el-select
            v-model="editData.useModule"
            placeholder="请选择使用模块"
            style="width:100%"
          >
            <el-option
              label="匹配系统"
              value="1"
            ></el-option>
            <el-option
              label="热门产品展示"
              value="2"
            ></el-option>
            <el-option
              label="匹配系统/热门产品展示"
              value="3"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item
          label="利率展示"
          prop="rateShow"
        >
          <el-input
            v-model="editData.rateShow"
            placeholder="请选择利率展示"
          ></el-input>
        </el-form-item>
        <el-form-item
          label="利率类型："
          prop="rateType"
        >
          <el-select
            v-model="editData.rateType"
            placeholder="请选择利率类型"
            style="width:100%"
          >
            <el-option
              label="日利率"
              value="1"
            ></el-option>
            <el-option
              label="月利率"
              value="2"
            ></el-option>
            <el-option
              label="年利率"
              value="3"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item
          label="贷款类型："
          prop="loanType"
        >
          <el-select
            v-model="editData.loanType"
            placeholder="请选择贷款类型"
            style="width:100%"
          >
            <el-option
              label="抵押贷"
              value="1"
            ></el-option>
            <el-option
              label="信用贷"
              value="2"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-form>

      <div
        slot="footer"
        class="dialog-footer"
      >
        <el-button @click="closeDialog">取 消</el-button>
        <el-button
          type="primary"
          @click="sumbitForm"
        >确 定</el-button>
      </div>
    </el-dialog>

  </div>
</template>

<script>
export default {
  name: "add",
  props: ["showDialog", "editData"],
  data() {
    return {};
  },
  methods: {
    // 重置表单

    closeDialog() {
      this.$emit("update:showDialog", false);
    },
    sumbitForm() {
      Request.POST(
        {
          api: "http://imisty.cn:8088/product-config/update",
          data: this.editData,
          ignore: true
        },
        res => {
          if (res.status == 200) {
            this.$message("修改成功");
            this.closeDialog();
          } else {
            this.$message("修改失败");
          }
        }
      );
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped  >
.dialog-detail .el-dialog__body {
  max-height: 400px !important;
  overflow: auto !important;
}
</style>
